package com.kaibes.platform.article.db;

import org.springframework.stereotype.Component;

import com.kaibes.orm.spring.TableInitialize;
import com.kaibes.platform.article.db.entity.ArticleCategory;
import com.kaibes.platform.article.db.service.ArticleCategoryService;

@Component
public class CategoryInitialize extends TableInitialize<ArticleCategoryService> {

    @Override
    public void onEmpty(ArticleCategoryService service) {
        ArticleCategoryService categoryService = (ArticleCategoryService) service;
        ArticleCategory articleCategory = new ArticleCategory();
        articleCategory.setName("默认分类");
        articleCategory.setSort((short) 1);
        categoryService.save(articleCategory);
    }

}
